import java.io.*;
import java.util.Arrays;
import java.util.Comparator;

public class h_5 {
    public static void main(String[] args) throws Exception {
        printFile("file.txt");
    }
    public static void printFile(String file) throws Exception {
        File f=new File(file);
        BufferedReader fis=new BufferedReader(new FileReader(file));
        StringBuffer str=new StringBuffer();
        Arrays.stream(fis.readLine().split("-")).sorted(new Comparator<String>() {
            @Override
            public int compare(String o1, String o2) {
                return Integer.parseInt(o1) - Integer.parseInt(o2);
            }
        }).forEach(a-> str.append(a+"-"));
        BufferedWriter fos=new BufferedWriter(new FileWriter(file));
        fos.write(str.toString().substring(0,str.length()-1));
        fos.close();
        fis.close();
    }
}
